﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DX
{
    class DefaultMessageCenter : IMessageCenter
    {
        public Task<bool> Confirmation(string message)
        {

            return Confirmation("确认", message);
        }

        public Task<bool> Confirmation(string title, string message)
        {

            var flag = MessageBox.Show(message, title, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
            return Task.FromResult(flag);
        }

        public Task Notification(string message)
        {
            throw new NotImplementedException();
        }

        public Task Show(string message)
        {
            return Show("消息", message);
        }

        public Task Show(string title, string message)
        {
            MessageBox.Show(message, title);
            return Task.CompletedTask;
        }

        public Task<OptionItem> ShowOptions(string title, string message, OptionItem[] options)
        {
            throw new NotImplementedException();
        }

        public Task<OptionItem> ShowOptions(string message, OptionItem[] options)
        {
            throw new NotImplementedException();
        }
    }
}
